package javase.array;

public class BankTest {
    public static void main(String[] args) {
        Bank.getinstance();
    }
}

class Bank {
    /*饿汉式,单例设计模式*/
    /*私有的构造器让这个类只能实例化一个对象,通过类名调用方法获得实例*/
    private Bank() {}
    private static Bank bank = new Bank();
    public static Bank getinstance() {
        return bank;
    }
}
